package com.kepler.social.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.concurrent.TimeUnit;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Time {

    private long time;

    private TimeUnit unit;

    public long toMinutes(){
        assert null != unit;
        return unit.toMinutes(time);
    }

    public long toHours(){
        assert null != unit;
        return unit.toHours(time);
    }
}